<?php  # Script -- array.php

/* Author @ Huoty
 *   Date @ 2015-03-11 14:01:15
 *  Brief @ 
 */

header("Content-Type: text/html; charset=utf-8");

$arr = array(
    "one" => "111",
    "two" => "222",
    "three" => "333"
);

echo "--------- 原数组 -----------" . "<br>";
foreach ($arr as $val)
{
    echo $val . "<br>";
}

/* 修改数组元素的值 */
$str = "two";
$arr["three"] = "ttt";
$arr[$str] = "www";

echo "------- 改变后数组 ----------" . "<br>";
foreach ($arr as $val)
{
    echo $val . "<br>";
}

?>
